<?php

class Core_Form_Admin_Settings_SiteInfo extends Core_Form_Admin_Settings_Abstract
{
	public function init()
	{
	    
        $this->setTitle('site information settings');
        
        $this->setDescription('core.admin.form.siteinfo.description');

		// init site maintenance mode
		$this -> addElement('Radio', 'maintenance_mode', array(
				'label' => 'maintainance',
				'required' => true,
				'multiOptions' => array(
						'on' => 'yes, user must have maintaince code to access this site.',
						'off' => 'no, this site is public and everyone can access it.',
				),
				'value'=>'off',
		));

		// init site maintenance code
		$this -> addElement('Text', 'maintenance_code', array(
				'label' => 'maintenance code',
				'class' => 'text long-text',
				'description' => 'If empty, a password will be randomly generated.',
				'filters' => array('StringTrim', ),
				'value'=>Nuo_Utility_String::createRandomString(8,1),
		));
        
        $this->addElement('select','site_locale',array(
            'label'=>'default locale',
            'multiOptions'=>Nuo_Utility_Locale::getLanguageNameList(),
            'desc'=>'core.form.admin.general.locale.desc'
        ));
        
        $this->addElement('select','site_language',array(
            'label'=>'default language',
            'multiOptions'=>Nuo_Utility_Locale::getLanguageNameList(),
            'desc'=>'core.form.admin.general.language.desc'
        ));
        
        $this->addElement('select','site_timezone',array(
            'label'=>'default timezone',
            'multiOptions'=>Nuo_Utility_Timezone::getAll(),
            'desc'=>'core.form.admin.general.timezone.desc'
        ));

		// init site title
		$this -> addElement('Text', 'site_meta_title', array(
				'label' => 'site title',
				'class' => 'text long-text',
				'value'=>'this is nuo example site',
		));

		// init site keywords
		$this -> addElement('textarea', 'site_meta_keywords', array(
				'label' => 'meta keywords',
				'class' => 'basic',
				'value'=>'nuosite, nuo platform'
		));
		
		// init site description
		$this -> addElement('textarea', 'site_meta_description', array(
				'label' => 'meta description',
				'class' => 'basic',
				'value'=>'this is instance of nuo site',
		));

		

		// init profile
		$this -> addElement('Radio', 'site_publish', array(
				'label' => 'site publish',
				'multiOptions' => array(
						'publish' => 'publish, everyonce can access this site.',
						'private' => 'private, only registered members can access content.'
				),
				'value'=>'publish'
		));

		// scripts/styles
		$this -> addElement('Textarea', 'headIncludes', array(
				'label' => 'head scripts/styles',
				'description' => 'append this code to before ending head section.'
		));

		// scripts/styles
		$this -> addElement('Textarea', 'bottomIncludes', array(
				'label' => 'Head Scripts/Styles',
				'description' => 'append this code to before ending body section.'
		));

		// init submit
		$this -> addElement('button', '_submit', array(
				'label' => 'save change',
				'type' => 'submit',
				'class' => 'submit',
				'decorators' => array('ViewHelper')
		));

		// init submit
		$this -> addElement('button', '_cancel', array(
				'label' => 'cancel',
				'type' => 'submit',
				'class' => 'cancel',
				'decorators' => array('ViewHelper')
		));

		$this -> addDisplayGroup(array(
				'_submit',
				'_cancel'
		), '_buttons');
	}

}
